#FROM jenkins/jenkins:lts
FROM jenkinsci/blueocean:latest
ENV JAVA_OPTS="-Djenkins.install.runSetupWizard=false"
COPY plugins.txt /usr/share/jenkins/plugins.txt
COPY security.groovy /usr/share/jenkins/ref/init.groovy.d/security.groovy
COPY create-demo-job.groovy /usr/share/jenkins/ref/init.groovy.d/create-demo-job.groovy

COPY install-maven-in-jenkins.groovy /usr/share/jenkins/ref/init.groovy.d/install-maven-in-jenkins.groovy
RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/plugins.txt

USER root

RUN wget http://mirrors.shu.edu.cn/apache/maven/maven-3/3.5.3/binaries/apache-maven-3.5.3-bin.tar.gz
RUN tar zxvf apache-maven-3.5.3-bin.tar.gz -C /usr/local/

RUN ln -s /usr/local/apache-maven-3.5.3 /usr/local/maven
ENV PATH=/usr/local/maven/bin/:$PATH

USER jenkins

